#include <stdio.h>
#include <pthread.h>
#include <unistd.h>

void* thread_run(void* args){
  const char* id = (const char*)args;
  while(1){
    printf("I am %s thread, %d\n", id, getpid());
    sleep(1);
  }
}

int main(){
  pthread_t tid;
  pthread_create(&tid, NULL, thread_run, (void*)"thread 1");

  while(1){
    printf("I am main thread, %d\n", getpid());
    sleep(1);
  }
  return 0;
}
